﻿using NMock2;
using NUnit.Framework;

namespace Tests
{
    [TestFixture]
    public abstract class TestBase
    {
        private Mockery _mockery;

        [SetUp]
        public virtual void SetUp()
        {
            _mockery = new Mockery();
        }

        [TearDown]
        public virtual void TearDown()
        {
            _mockery.Dispose();
        }

        public T NewMock<T>()
        {
            return _mockery.NewMock<T>();
        }


        public static byte[] StrToByteArray(string str)
        {
            var encoding = new System.Text.UTF8Encoding();
            return encoding.GetBytes(str);
        }
        
    }
}
